import React from 'react';

interface IconProps {
  iconClass: string;
  size?: string | number;
  color?: string;
}

const Icon: React.FC<IconProps> = ({ iconClass, size = '1em', color }) => {
  const styles = {
    fontSize: typeof size === 'string' ? size : `${size}px`,
    color,
  };

  return <i className={`iconfont ${iconClass}`} style={styles}></i>;
};

export default Icon;
